package com.bytedance.ttnet.a;

import android.content.Context;
import android.content.SharedPreferences;

public final class f {
    volatile int a;
    volatile long b;
    volatile int c;
    volatile int d;
    private static volatile f e;
    private static final Object f;
    private volatile Context g;
    private static volatile SharedPreferences h;

    static {
        f = new Object();
    }

    private f(Context arg5) {

        if (arg5 != null) {
            this.g = arg5.getApplicationContext();
        }

        try {
            SharedPreferences v0_1 = this.b();
            this.a = v0_1.getInt("image_opt_switch", 0);
            this.b = v0_1.getLong("image_opt_black_interval", 0);
            this.c = v0_1.getInt("image_opt_failed_times", 0);
            this.d = v0_1.getInt("image_opt_limit_count", 0);
        } catch (Throwable v0) {
            v0.printStackTrace();
        }
    }

    public static f a(Context arg2) {
        if (e == null) {
            Object v1 = f;
            synchronized (v1) {
                if (e == null) {
                    e = new f(arg2);
                }
            }
        }

        return e;
    }

    public static f a() {
        return e;
    }

    final SharedPreferences b() {
        if (h == null) {
            h = this.g.getSharedPreferences("image_opt_table", 0);
        }

        return h;
    }
}

